function Comic() {
	this.ctl = $('.window-control');
}

Comic.prototype.HandelHeader = function () {
	var self = this;
	var header = $('#header');
	window.onscroll = function () {
		var t = document.documentElement.scrollTop || document.body.scrollTop;
		if (t>=76) {
			header.css({'opacity': 0.5});
			self.ctl.show();
		} else {
			header.css({'opacity': 1});
			self.ctl.hide();
		}
	}
}

Comic.prototype.PageSilder = function () {
	var toTop = this.ctl.find('li').eq(0);
	var toBottom = this.ctl.find('li').eq(1);
	toTop.on("click", function() {
      	$('body,html').animate({scrollTop: 0}, 500);
		return false;
     });
	toBottom.on("click", function () {
		var bottom = $(document).height();
		$('body,html').animate({scrollTop: bottom}, 500);
	    return false;
	})
}

Comic.prototype.run = function () {
	this.HandelHeader();
	this.PageSilder();
}

$(function () {
	var comic = new Comic();
	comic.run();
})